<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Login Page</title>
    <meta name="msapplication-TileColor" content="#5bc0de" />
    <meta name="msapplication-TileImage" content="assets/img/metis-tile.png" />

    <!-- Bootstrap -->
    <link rel="stylesheet" href="__PUBLIC__/metis/assets/lib/bootstrap/css/bootstrap.min.css">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="__PUBLIC__/metis/assets/lib/font-awesome/css/font-awesome.min.css">

    <!-- Metis core stylesheet -->
    <link rel="stylesheet" href="__PUBLIC__/metis/assets/css/main.min.css">
    <link rel="stylesheet" href="__PUBLIC__/metis/assets/lib/animate.css/animate.min.css">
  </head>
  <body class="login">
    <div class="form-signin">
      <div class="text-center">
        <img src="__PUBLIC__/metis/assets/img/logo.png" alt="Metis Logo">
      </div>
      <hr>
      <div class="tab-content">

        <div id="login" class="tab-pane active">

          <form id="loginForm" method="post">
            <p class="text-muted text-center">
              请输入您的用户名和密码
            </p>
            <input type="text" placeholder="用户名" name="username" class="form-control top">
            <input type="password" placeholder="密码" name="password" class="form-control bottom">
            <div class="checkbox">
              <label style="font-size : 8px; color : #888">
                <input type="checkbox" >在此电脑上记住用户名
              </label>
            </div>
            <button id="btnSubmitLogin" class="btn btn-lg btn-primary btn-block" type="button">登陆</button>
          </form>

        </div>
    </div>


      <hr>
      <div class="text-center" id="loginResult" style="color: red">
        
      </div>
    </div>
    <script src="__PUBLIC__/metis/assets/lib/jquery/jquery.min.js"></script>
    <script src="__PUBLIC__/metis/assets/lib/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript">
     $(function(){

     	$("#btnSubmitLogin").click(function(){

     		var sendData = $("#loginForm").serialize();

     		$.post("{:U('checkLogin')}", sendData).done(function(responseData){
     			//console.log(responseData);
     			if(responseData.status === 1){
     				$("#loginResult").text(responseData.info);
     				location.href = responseData.jumpUrl;
     			}else{
     				$("#loginResult").text(responseData.info);
     			}
     		});

     	});

     });
    </script>
  </body>
</html>
